/**   
 * @文件名称: LogAction.java
 * @类路径: com.tdcms.cms.manage.action.user
 * @描述: TODO
 * @公司：昆明天度网络信息科技有限公司
 * @作者：李兴建
 * @时间：2013-7-23 下午05:33:57
 * @版本：V1.0   
 */

package com.lxj.cms.manage.action.user;

import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Results;
import org.hibernate.Criteria;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;

import com.lxj.cms.manage.action.ManageBaseAction;
import com.lxj.core.action.IBaseAction;
import com.lxj.core.entity.SYSLogs;

/**
 * @类功能说明：
 * @类修改者：
 * @修改日期：
 * @修改说明：
 * @公司：昆明天度网络信息科技有限公司
 * @作者：李兴建
 * @创建时间：2013-7-23 下午05:33:57
 * @版本：V1.0
 */
@SuppressWarnings("serial")
@Results( { @Result(name = "index", location = "/WEB-INF/admin/admin/log.jsp"), @Result(name = "userGropEdit", location = "/WEB-INF/cmsManage/user/userGropEdit.jsp") })
public class LogAction extends ManageBaseAction implements IBaseAction {
	// 日志类型 (0:管理员 1：用户)
	private int logType;

	private String title;

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.tdcms.core.action.IBaseAction#dataList()
	 */
	@Override
	public void dataList() {
		// TODO Auto-generated method stub
		Criteria criteria = this.createCriteria(SYSLogs.class);
		criteria.addOrder(Order.desc("beanLastModidyfiTime"));
		criteria.add(Restrictions.eq("logType", logType));
		this.setResult(criteria);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.tdcms.core.action.IBaseAction#editPage()
	 */
	@Override
	public String editPage() {
		// TODO Auto-generated method stub
		return null;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.tdcms.core.action.IBaseAction#index()
	 */
	@Override
	public String index() {
		// TODO Auto-generated method stub
		return "index";
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.tdcms.core.action.IBaseAction#preservation()
	 */
	@Override
	public String preservation() {
		// TODO Auto-generated method stub
		return null;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.tdcms.core.action.IBaseAction#remove()
	 */
	@Override
	public String remove() {
		// TODO Auto-generated method stub
		return null;
	}

	public int getLogType() {
		return logType;
	}

	public void setLogType(int logType) {
		this.logType = logType;
	}

	public String getTitle() {
		switch (logType) {
		case 0:
			title = "管理员";
			break;
		case 1:
			title = "会员";
			break;

		default:
			break;
		}
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

}
